/*
 * ExceptionUtils.java
 *
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package OpenToday.Tools;

import java.util.Vector;

/**
 *
 * @author menny
 */
public class ExceptionUtils {

    private static Vector ms_stack = new Vector();

    // only print debug info if needed
    private final static boolean debug = true;

    public static synchronized void PHASE(String phase) {

        if (debug == true) {
            while (ms_stack.size() >= 5) {
                ms_stack.removeElementAt(0);
            }
            ms_stack.addElement(phase);
            System.out.println(phase);
        }
    }

    public static synchronized String getPhases() {
        String phases = "";
        for (int i = ms_stack.size(); i > 0; i--) {
            phases += ms_stack.elementAt(i - 1) + "\n\r";
        }
        return phases;
    }
}
